package com.myproject.student.emtity;

import java.util.Scanner;

/**
 * @Description:学生信息管理系统
 * @Author: 2586114359
 * @date: 2024.03.23
 */
public class Student {
    String name;
    int age;
    String StudentID;
    //构造方法
    public Student (String name, int age, String studentID){
        this.name = name;
        this.age = age;
        this.StudentID = studentID;
    }
    //打印学生信息
    public void printfInfo(){
        System.out.println("Name:" + name + ". Age：" + age + ". com.myproject.student.emtity.Student ID：" + StudentID);
    }
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        //输入学生信息
        System.out.print("Enter name：");
        String name = scanner.nextLine();
        System.out.print("Enter age:");
        int age = scanner.nextInt();
        scanner.nextLine();//消费换行符
        System.out.print("Enter com.myproject.student.emtity.Student ID:");
        String StudentID = scanner.nextLine();
        //创建学生对象并打印信息
        Student student = new Student(name, age, StudentID);
        student.printfInfo();
    }

}
